<template>
	<view>
		<view class="test">
			<web-view :webview-styles="webviewStyles" :src="htmlSrc" style="font-size: 30rpx!important;"></web-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsContent:"",
				htmlSrc:"",
				webviewStyles:{
					progress:"#FF3333",
	                fontSize: "40rpx"
				},
				token: '',
				thumb:"",
				title:""
			}
		},
		onReady() {
		     // #ifdef APP-PLUS
		     var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效，非v3编译模式使用this.$mp.page.$getAppWebview()
			 // setTimeout(function() {
		  //        wv = currentWebview.children()[0]
		  //    	console.log(wv)
		  //        wv.setStyle({top:150,height:300})
		  //    }, 1000); //如果是页面初始化调用时，需要延时一下
		     // #endif
		},
		onLoad(options) {
			if(options.type){
				this.loadWebPage(options.type)
			}

            // _this.thumb = options.thumb;
            // _this.title = options.title;
		},
		methods: {
		    loadWebPage(type){
				if(type == 1){
					//隐私政策
					this.htmlSrc = "http://www.creb.com.cn/authorization/privacy-policy.html"
				}else if(type == 2){
					// 服务协议
					this.htmlSrc = "http://www.creb.com.cn/authorization/service-agreement.html"
				}else if(type == 3){
					this.htmlSrc = "http://www.creb.com.cn/authorization/about-us.html"
				}else if(type == 4){
					this.htmlSrc = "http://www.creb.com.cn/special/bqsm/index.html"
				}else if(type == 5){
					this.htmlSrc = "http://www.creb.com.cn/special/wdxx/index.html"
				}else if(type == 6){
					this.htmlSrc = "http://www.creb.com.cn/special/lxwm/index.html"
				}else if(type == 7){
					this.htmlSrc = "http://www.creb.com.cn/special/pphd/index.html"
				}
			}
		}
	}
</script>

<style>

</style>

